package com.cv.system.controller.system.user.vo.user;

import com.cv.framework.common.pojo.PageParam;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;

import static com.cv.framework.common.utils.date.DateUtil.FORMAT_YEAR_MONTH_DAY;

/**
 * 后台管理系统 - 用户分页 Request VO
 *
 * @author Charles_XDXD
 */
@Schema(description = "后台管理系统 - 用户分页 Request VO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class UserPageReqVO extends PageParam {

    @Schema(description = "用户账号，模糊匹配", example = "hr")
    private String username;

    @Schema(description = "手机号码，模糊匹配", example = "hr")
    private String mobile;

    @Schema(description = "用户昵称，模糊匹配", example = "Charles")
    private String nickname;

    @Schema(description = "邮箱，模糊匹配", example = "hr")
    private String email;

    @Schema(description = "展示状态，参见 CommonStatusEnum 枚举类", example = "1")
    private Integer status;

    @Schema(description = "最后一次登录时间", example = "[2022-07-01, 2022-07-01]")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate[] loginDate;

    @Schema(description = "创建时间", example = "[2022-07-01, 2022-07-01]")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate[] createTime;

}
